 _    _                _     ___                        _   _
| |__| |__  __ ___  __| |___| _ \__ _ _ _ ___ ___ _ _  / | / | 
| '_ \ '_ \/ _/ _ \/ _` / -_)  _/ _` | '_(_-</ -_) '_| | | | |
|_.__/_.__/\__\___/\__,_\___|_| \__,_|_| /__/\___|_|   |_(_)_|



This is the documentation for bbcode parser 1.1

License.
You may use this and edit as you wish.
This is open source, in the spirit of sharing and learning.
If you improve upon this and would like to give the author a copy,
ask any questions or give suggestions. Send me an email:

stefan /AT frolich DOT; co DOT cc 
              OR
sfroelich01 AT. gmail 'DOT com


***********
*Changelog*
***********

*Introduced new variable $parser_object->quotes
 Use to set whether or not slashes due to magic_quotes_gpc() will be slashed
 
*Changed default smiley folder path to root directory to allow smileys to be applied to all pages without much work on coders part

*Removed check for valid smiley folder. Had issues after changing default path


**********
*Features*
**********

*Common bbcodes

*96 smileys with twice as many codes to call them

*supports magic_quotes_gpc() ON or OFF

*supports htmlentities() or htmlspecialchars()

*supports newlines and word wrapping with bbcodes but not smileys

*Supports nested codes though it does not correct improper nesting


*******
*TODO:*
*******

*custom made smileys not yahoomessenger smileys

*add a few more bbcodes such eg.[table]

*clean regex a bit more and make it more compatible with typed entities


***********
*Contents:*
***********

You should have included in the zip:

*bbcodeParser.php (main class file to be included and called by your scripts)

*bbcode.php (a simple test form for the parser)

*smileys.htm (contains list of smileys and bbcodes supported by parser)

*smileys/ (folder containing smileys)

*readme


*************
*How to use:*
*************

1.You need to either include or require bbcodeParser.php in your script.

	include ('path/bbcodeParser.php');

	
2.An object of the parser class is then instantiated

	$parser_object= new bbcodeParser();

	
3.The string to be parsed is set like this

	$parser_object->codeString= $string_to_be_parsed;

	
4.The string is then parsed by calling the parseString() method

	$parsed_string= $parser_object->parseString();

	The returned string has had bbcode and smileys parsed.



*********************	
*Optional properties*
*********************

1. $parser_object->debug

	This is set to 1 by default. Setting to 0 will prevent error messages from being echoed.
    Please set to 0 before putting your website into production	
	

2. $parser_object->smileys
	
	This is the path to the smiley folder.
	By default, this is set to the root directory. There isn't much need in changing this 
	in this version of the parser if you keep the directory in the root.
	If you need to keep this folder in a different directory however, specify this using the 
	$bbcodeParserObject->smileys property making sure that you give a path from the root.
		
		eg. $parser_object->smileys = '/subdir/smileys/';
		eg. $parser_object->smileys = '/subdir1/subdir2/smileys/';
		
	Note the trailing and leading '/'.
	This ensures that all pages have access to the images.
	This will be necessary in cases where you use a subdomain and wish to keep the smileys 
	folder in the subdirectory and not the root.
		
		eg. $parser_object->smileys = '/subdomain_dir/smileys/';
	
	
3. $parser_object->quotes;

	If you have already set up a system to strip magic_quotes slashes, set this to 0.
	Else, the parser will check if magic_quotes() is turned on and then strip the slashes from your string.
	
	
*****
*FAQ*
*****
*
Q. Why do get a message telling me "String to be parsed is empty. Please set $bbcodeParserObject->codeString to a valid string."

A. You need to specify a string before trying to parse it. Check item 3 of *How to Use*





* * *                                                               * * *
You can look at bbcode.php for an example of how to use the parser class.

$bbcodeParserObject and $parser_object refer to your instantiated instance
                         of the parser.
* * *                                                               * * *